package com.gopay.checkorder.manager.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.checkorder.dao.BankAuthOrderDAO;
import com.gopay.checkorder.manager.BankAuthOrderManager;
import com.gopay.common.domain.bank.BankAuthOrder;
import com.gopay.common.util.DateUtils;
/** 
 * 委托代收认证主订单Manager 实现
 * @ClassName: BankAuthOrderManagerImpl 
 * @author lilili
 * @date 2017年2月19日 下午1:42:38  
 */ 
@Service("bankAuthOrderManager")
public class BankAuthOrderManagerImpl implements BankAuthOrderManager {

	    @Resource(name = "bankAuthOrderDAO")
	    private BankAuthOrderDAO bankAuthOrderDAO;
	 
	    @Override
	    public int updateAutoQuerySuccess(BankAuthOrder authOrder) {
	        Date curDate = DateUtils.getSystemDate();
	        authOrder.setLastUpdTs(curDate);
	        int result = bankAuthOrderDAO.updateBackStatus(authOrder);
	        return result;
	    }

	    @Override
	    public int updateBackVerifyFail(BankAuthOrder authOrder) {
	        Date curDate = DateUtils.getSystemDate();
	        authOrder.setLastUpdTs(curDate);
	        int result = bankAuthOrderDAO.updateBackStatus(authOrder);
	        return result;
	    }

	    @Override
	    public int updateAutoQueryFail(BankAuthOrder authOrder) {
	        Date curDate = DateUtils.getSystemDate();
	        authOrder.setLastUpdTs(curDate);
	        int result = bankAuthOrderDAO.updateBackStatus(authOrder);
	        return result;
	    }

}
